﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
    public partial class FormAdminAccess : Form
    {
        public ForumService forumService;

        public List<string> users;

        public FormAdminAccess(List<string> uList,string stats,ForumService fs)
        {
            InitializeComponent();
            this.forumService = fs;
            this.users = uList;
            this.listBox1.DataSource = uList;
            this.textBox1.Text = stats;
            this.textBox1.Enabled = false;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            int r = listBox1.SelectedIndex;
            if (String.IsNullOrEmpty(maskedTextBox1.Text))
                new FormError("the Forum field is empty!").Show();
           // else
               // forumService.CreateForum(users[r], maskedTextBox1.Text);
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.forumService.adminExit();
            this.Dispose();
        }

      
    }
}
